package com.medical.app.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.medical.app.common.dto.HospitalizedRechargeDto;
import com.medical.app.entity.BeHospitalized;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface BeHospitalizedMapper extends BaseMapper<BeHospitalized> {
    default List<BeHospitalized> selectByPatientId(Long patientId) {
        QueryWrapper<BeHospitalized> qw = new QueryWrapper<>();
        qw.lambda().eq(BeHospitalized::getPatientId,patientId);
        return this.selectList(qw);
    }

    HospitalizedRechargeDto selectMessage(Long patientId);

    List<HospitalizedRechargeDto> selectHospitalizedList(@Param("patientId") Long patientId,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
}